<?php
/**
 * 描述：会员注册-成功。
 */
final class Exec_Account_Register_Success extends Exec
{
    public function Get()
    {
        #如果不是从register.html跳转就直接返回register.html
        if(($data=Session::Get(Account::SESSIONNAME_REGISTERDATA))==NULL)
        {
            header('Location:/exec.php?action=account_register_first');
            return;
        }
        else
        {
            if($data['Linkman']==NULL)
            {
                header('Location:/exec.php?action=account_register_first');
                return;
            }
        }

        #显示页面
        View::Assign('Username',$data['Username']);
        View::Assign('Email',$data['Username']);
        View::Display('account/register/success.tpl');

        #存储验证数据
        $guid=Functions::GUID();
        DB::Insert('account_email_wait',array
        (
            'Number'=>$guid,
            'Account'=>$data['Username']          
        ));

        #发送Email
        $email=new Email();
        $email->IsHTMLEmail=TRUE;
        $email->Recipients=$data['Username'];
        $email->Title='中国船舶配套，注册电子邮件验证。';
        $email->Content='感谢您注册中国船舶配套网，请点击下面的链接验证您的Email。<br/>';
        $email->Content.='http://www.shipinall.cn/exec.php?action=account_register_email&';
        $email->Content.='number='.urlencode($guid).'<br/>';
        $email->Content.='--中国船舶配套网';
        $email->Send();
        
        #清除Session,释放数据
        Session::Set(Account::SESSIONNAME_REGISTERDATA,NULL);
    }
}
?>